<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>06-Vue条件渲染</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<!--1.准备一个div容器-->
<div id="app">
    <p>{{age}}</p>
    <p v-if="age>=18">成年</p>
    <p v-if="score>=90">优秀</p>
    <p v-else-if="score>=80">良好</p>
    <p v-else-if="score>=60">及格</p>
    <p v-else>不及格</p>
    <button @click="fun1">点我年龄加1</button>
    <button @click="fun2">点我分数加10</button>
</div>
<script>
    <!--2.准备一个Vue对象和容器绑定-->
    const vm = new Vue({
        el: "#app",
        data: {
            age: 17,
            score:59,
        },
        methods: {
            fun1: function () {
                this.age++;
            },
            fun2:function () {
                this.score+=10;
            }
        },
    });
</script>
</body>
</html>